<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: display/font.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_e4fd3481c5e8112931e161ebbc5af0ff.html">display</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">font.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Font display for ili9341 driver Displays fonts generated by bdffont2c BDF to C code converter BDF = Glyph Bitmap Distribution Format The code handles fixed, proportional and bounding box format fonts.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;stdarg.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &quot;<a class="el" href="ili9341_8h_source.html">display/ili9341.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="display_2font_8h_source.html">display/font.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="fonts_8h_source.html">fonts.h</a>&quot;</code><br />
</div>
<p><a href="font_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a52d60ae7ccb513718808b5cdbb26ffa3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#a52d60ae7ccb513718808b5cdbb26ffa3">MEMSPACE_FONT</a>&#160;&#160;&#160;<a class="el" href="earth2wireframe_8c.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></td></tr>
<tr class="memdesc:a52d60ae7ccb513718808b5cdbb26ffa3"><td class="mdescLeft">&#160;</td><td class="mdescRight">save fonts in flash  <a href="#a52d60ae7ccb513718808b5cdbb26ffa3">More...</a><br /></td></tr>
<tr class="separator:a52d60ae7ccb513718808b5cdbb26ffa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a809b205bdd1c95f9a10bb429681a8f9e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#a809b205bdd1c95f9a10bb429681a8f9e">font_max</a> ()</td></tr>
<tr class="separator:a809b205bdd1c95f9a10bb429681a8f9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec37c6383e20a1fef1cd4924060ed693"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#aec37c6383e20a1fef1cd4924060ed693">font_H</a> (int <a class="el" href="bdffontutil_8h.html#a6d9c6f27190f0f04abf55678fe81080d">font</a>)</td></tr>
<tr class="memdesc:aec37c6383e20a1fef1cd4924060ed693"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get font height used for line to line spacing.  <a href="#aec37c6383e20a1fef1cd4924060ed693">More...</a><br /></td></tr>
<tr class="separator:aec37c6383e20a1fef1cd4924060ed693"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a647c0e54986f2520898707b8accd28f3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#a647c0e54986f2520898707b8accd28f3">font_W</a> (int <a class="el" href="bdffontutil_8h.html#a6d9c6f27190f0f04abf55678fe81080d">font</a>)</td></tr>
<tr class="memdesc:a647c0e54986f2520898707b8accd28f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get font Width used for character to character spacing.  <a href="#a647c0e54986f2520898707b8accd28f3">More...</a><br /></td></tr>
<tr class="separator:a647c0e54986f2520898707b8accd28f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acea4413f1d84d044b7d83a96bb0bcb79"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#acea4413f1d84d044b7d83a96bb0bcb79">font_attr</a> (<a class="el" href="structwindow.html">window</a> *win, int c, <a class="el" href="struct__fontc.html">_fontc</a> *f)</td></tr>
<tr class="memdesc:acea4413f1d84d044b7d83a96bb0bcb79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get font attributes for a font.  <a href="#acea4413f1d84d044b7d83a96bb0bcb79">More...</a><br /></td></tr>
<tr class="separator:acea4413f1d84d044b7d83a96bb0bcb79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87fb749b0b5887e26f76d1292b93b0ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#a87fb749b0b5887e26f76d1292b93b0ed">tft_drawChar</a> (<a class="el" href="structwindow.html">window</a> *win, <a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> c)</td></tr>
<tr class="memdesc:a87fb749b0b5887e26f76d1292b93b0ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Display a character and optionally wrap the graphic cursor.  <a href="#a87fb749b0b5887e26f76d1292b93b0ed">More...</a><br /></td></tr>
<tr class="separator:a87fb749b0b5887e26f76d1292b93b0ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ad30601ef15ca84a341c6a7a1dc1d61b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__font.html">_font</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="font_8c.html#ad30601ef15ca84a341c6a7a1dc1d61b1">allfonts</a> []</td></tr>
<tr class="memdesc:ad30601ef15ca84a341c6a7a1dc1d61b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Include the Generated Font table The generated tables always include Font specifications: width, height, offsets, font type, etc Font information: name, copyright, style information Note: FONSPECS and FONTINFO defines controls actual usage. We can also overide FONTSPECS here or in the Makefile for testing.  <a href="#ad30601ef15ca84a341c6a7a1dc1d61b1">More...</a><br /></td></tr>
<tr class="separator:ad30601ef15ca84a341c6a7a1dc1d61b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Font display for ili9341 driver Displays fonts generated by bdffont2c BDF to C code converter BDF = Glyph Bitmap Distribution Format The code handles fixed, proportional and bounding box format fonts. </p>
<dl class="section see"><dt>See also</dt><dd><a href="http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format">http://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format</a></dd></dl>
<dl class="section user"><dt>Copyright &copy; 2015 Mike Gore, GPL License</dt><dd></dd></dl>
<dl class="section user"><dt>You are free to use this code under the terms of GPL</dt><dd>Please retain a copy of this notice in any code you use it in.</dd></dl>
<p>This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
<p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>. </p>

<p>Definition in file <a class="el" href="font_8c_source.html">font.c</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a52d60ae7ccb513718808b5cdbb26ffa3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MEMSPACE_FONT&#160;&#160;&#160;<a class="el" href="earth2wireframe_8c.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>save fonts in flash </p>

<p>Definition at line <a class="el" href="font_8c_source.html#l00042">42</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="acea4413f1d84d044b7d83a96bb0bcb79"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int font_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwindow.html">window</a> *&#160;</td>
          <td class="paramname"><em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__fontc.html">_fontc</a> *&#160;</td>
          <td class="paramname"><em>f</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get font attributes for a font. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*win</td><td>Window Structure </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">c</td><td>character </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">*f</td><td>font structure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>font number </dd></dl>

<p>Definition at line <a class="el" href="font_8c_source.html#l00094">94</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

<p>Referenced by <a class="el" href="ili9341_8c_source.html#l01601">tft_cleareol()</a>, <a class="el" href="ili9341_8c_source.html#l01621">tft_clearline()</a>, <a class="el" href="font_8c_source.html#l00200">tft_drawChar()</a>, <a class="el" href="ili9341_8c_source.html#l01296">tft_get_font_height()</a>, and <a class="el" href="ili9341_8c_source.html#l01643">tft_putch()</a>.</p>

</div>
</div>
<a class="anchor" id="aec37c6383e20a1fef1cd4924060ed693"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int font_H </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>font</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get font height used for line to line spacing. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">font</td><td>font number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Height in pixels </dd></dl>

<p>Definition at line <a class="el" href="font_8c_source.html#l00070">70</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

<p>Referenced by <a class="el" href="user__main_8c_source.html#l00783">test_types()</a>, and <a class="el" href="ili9341_8c_source.html#l01254">tft_set_textpos()</a>.</p>

</div>
</div>
<a class="anchor" id="a809b205bdd1c95f9a10bb429681a8f9e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int font_max </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="font_8c_source.html#l00059">59</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

<p>Referenced by <a class="el" href="ili9341_8c_source.html#l01267">tft_set_font()</a>.</p>

</div>
</div>
<a class="anchor" id="a647c0e54986f2520898707b8accd28f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int font_W </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>font</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get font Width used for character to character spacing. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">font</td><td>font number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Width in pixels </dd></dl>

<p>Definition at line <a class="el" href="font_8c_source.html#l00080">80</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

<p>Referenced by <a class="el" href="ili9341_8c_source.html#l01254">tft_set_textpos()</a>.</p>

</div>
</div>
<a class="anchor" id="a87fb749b0b5887e26f76d1292b93b0ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tft_drawChar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwindow.html">window</a> *&#160;</td>
          <td class="paramname"><em>win</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Display a character and optionally wrap the graphic cursor. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="ili9341_8h.html#afaf6907405d24bf529df5590f450d3cd" title="put character in current winoow ">tft_putch</a> for <a class="el" href="cordic2c_8c.html#a0ddf1224851353fc92bfbff6f499fa97" title="Create C Cordic Tables and test the results. ">main</a> output function Does not handle control characters </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">*win</td><td>Window Structure of active window </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">c</td><td>character </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void TODO: To make proportional fonts render even better we should reduce the font gap so that all of the active pixels between two fonts come no nearer then a defined value. Example: consider the characters "Td", the 'd' can actually be part way INSIDE the T </dd></dl>

<p>Definition at line <a class="el" href="font_8c_source.html#l00200">200</a> of file <a class="el" href="font_8c_source.html">font.c</a>.</p>

<p>Referenced by <a class="el" href="ili9341_8c_source.html#l01643">tft_putch()</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ad30601ef15ca84a341c6a7a1dc1d61b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct__font.html">_font</a>* allfonts[]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Include the Generated Font table The generated tables always include Font specifications: width, height, offsets, font type, etc Font information: name, copyright, style information Note: FONSPECS and FONTINFO defines controls actual usage. We can also overide FONTSPECS here or in the Makefile for testing. </p>

<p>Definition at line <a class="el" href="fonts_8h_source.html#l14699">14699</a> of file <a class="el" href="fonts_8h_source.html">fonts.h</a>.</p>

<p>Referenced by <a class="el" href="bdfview_8c_source.html#l00053">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
